<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>首页</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/common_widget_a1e249e.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/base_4c6d945.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/common.css">
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.12.2.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/func.js"></script>
</head>
<body>
	<div class="wdg-second-header">
		<div class="main-section">
			<a href="index" class="brand-logo mt5 mr10">
				<img src="${pageContext.request.contextPath }/images/we-logo_79fb26f.png" alt="logo">
			</a>
			<ul class="site-nav">
				<li class="channel-item">
					<a href="index">投资</a>
				</li>
				<li class="channel-item">
					<c:choose>
						<c:when test="${user == null }">
							<a href="user/login">我的账户</a>
						</c:when>
						<c:otherwise>
							<a href="index?action=user">我的账户</a>
						</c:otherwise>
					</c:choose>
				</li>
				<c:if test="${user != null }">
					<li class="channel-item" >
						<a href="user/logout">退出登录</a>
					</li>
				</c:if>
			</ul>
		</div>
	</div>
	<c:choose>
		<c:when test="${action eq 'index' }">
			<div class="banner">
				<img alt="" src="${pageContext.request.contextPath }/images/banner.png">
			</div>
			<div class="box" id="main"></div>
		</c:when>
		<c:otherwise>
			<div class="box marTop" id="main"></div>
		</c:otherwise>
	</c:choose>
	<input class="hidden" value="${productId }" id="product">
	<input class="hidden" value="${action }" id="action">
	<script type="text/javascript">
		$(document).ready(function(){
			var action = $("#action").val();
			if(action == "detail"){
				var productId = $("#product").val();
				loadPage("product/detail?id=" + productId);
			}else if(action == "user"){
				loadPage("user");
			}else {
				loadPage("product");
			}
		});
	</script>
</body>
</html>